<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/_fragments :: head(~{::title})">
    <title>标签管理</title>
</head>
<body>
<!--导航条-->
<nav th:replace="admin/_fragments :: menu(3)"></nav>
<div class="ui menu attached pointing m-bg animated fadeInDown">
    <div class="ui container">
        <div class="right mini menu">
            <a th:href="@{/admin/tags/input}" class="item m-pink">发布</a>
            <a th:href="@{/admin/tags}" class="item active m-pink">列表</a>
        </div>
    </div>
</div>
<!--中间内容-->
<div class="m-container-large m-padded-tb-big animated bounceInUp">
    <div class="ui container">
        <div class="ui success  message m-bg" th:unless="${#strings.isEmpty(message)}">
            <i class="close icon"></i>
            <div class="header">提示：</div>
            <p th:text="${message}"></p>
        </div>
        <table class="ui table compact m-bg center aligned">
            <thead class="m-bg">
                <tr class="m-bg">
                    <th class="m-bg m-pink m-text-thin"></th>
                    <th class="m-bg m-pink m-text-thin">标签名称</th>
                    <th class="m-bg m-pink m-text-thin">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="type,iterStat : ${page.content}">
                    <td th:text="${iterStat.count}">1</td>
                    <td th:text="${type.name}">springboot</td>
                    <td>
                        <a th:href="@{/admin/tags/{id}/input(id=${type.id})}" class="ui mini teal basic button ">编辑</a>
                        <a th:href="@{/admin/tags/{id}/delete(id=${type.id})}" class="ui mini red basic button ">删除</a>
                    </td>
                </tr>
            </tbody>
            <tfoot class="m-bg">
                <tr class="m-bg">
                    <th colspan="6" class="m-bg">
                        <div class="ui mini pagination floated left  menu m-bg" th:if="${page.totalPages}>1">
                            <a th:href="@{/admin/tags(page=${page.number}-1)}" class=" item m-bg" th:unless="${page.first}">上一页</a>
                            <a th:href="@{/admin/tags(page=${page.number}+1)}" class=" item m-bg" th:unless="${page.last}">下一页</a>
                        </div>
                        <a th:href="@{/admin/tags/input}" class="ui mini right floated teal basic button">新增</a>
                    </th>
                </tr>
            </tfoot>
        </table>
    </div>
</div>
<!--/*/<th:block th:replace="admin/_fragments :: script">/*/-->
<!--/*/</th:block>/*/-->
</body>
</html>
<script>
    <!-- 移动端导航条   -->
    $(".toggle.menu").click(function (){
        $(".m-item").toggleClass("m-mobile-hide")
    })
    $(".ui.dropdown").dropdown({
        on:'hover'
    });
    $(".message .close").on('click',function () {
        $(this).closest(".message")
        .transition("fade");
    })
</script>